package com.imti.mall.sale.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.imti.mall.model.sms.pojo.SmsCoupon;
import com.imti.mall.model.sms.pojo.SmsCouponHistory;
import com.imti.mall.model.sms.pojo.SmsCouponProductCategoryRelation;
import com.imti.mall.model.sms.pojo.SmsCouponProductRelation;
import com.imti.mall.model.sms.vo.CouponHistoryQuery;
import com.imti.mall.model.sms.vo.CouponQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SmsCouponMapper extends BaseMapper<SmsCoupon> {

  List<SmsCoupon> getList(@Param("query") CouponQuery couponQuery);

  int updateCouponById(@Param("query") SmsCoupon smsCoupon);

  List<SmsCouponProductCategoryRelation> getProductCateRelationByCouponId(@Param("id") Long id);

  List<SmsCouponProductRelation> getCouponProductById(@Param("id") Long id);

  int updateProductById(@Param("query")SmsCouponProductRelation smsCouponProductRelation);

  int updateCategoryRelationById(@Param("query") SmsCouponProductCategoryRelation smsCouponProductCategoryRelation);

  int addSmsCouponMsg(@Param("query") SmsCoupon smsCoupon);

  int addSmsProductCoupon(@Param("query") SmsCouponProductRelation smsCouponProductRelation);

  int addSmsCategoryCoupon(@Param("query") SmsCouponProductCategoryRelation smsCouponProductCategoryRelation);

  int deleteCategoryCouponById(@Param("id") Long id);

  int deleteProductCouponById(@Param("id") Long id);

  List<SmsCouponHistory> getHistoryList(@Param("query") CouponHistoryQuery couponHistoryQuery, @Param("startNum") Integer startNum, @Param("pageSize") Integer pageSize);

    SmsCoupon getCouponById(@Param("id") Long id);

  long getHistoryCount(@Param("query") CouponHistoryQuery couponHistoryQuery);
}
